﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LightCAD.UI
{
    public partial class LayerDropDown : DropDownControl
    {
        private bool isUpdating;
        public LayerDropDown()
        {
            isUpdating = true;
            InitializeComponent();
            InitializeDropDown(itemsPanel);
            isUpdating = false;
            InitLayers();
            this.Load += LayerDropDown_Load;
        }

        private void InitLayers()
        {
            for (var i = 0; i < 10; i++)
            {
                var layerItem = new LayerItemControl();
                layerItem.ItemClick += LayerItem_ItemClick;
                itemsPanel.Controls.Add(layerItem);
            }
        }

        private void LayerItem_ItemClick(object? sender, EventArgs e)
        {
           
        }

        private void LayerDropDown_Load(object? sender, EventArgs e)
        {

        }

        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (isUpdating || this.DropState != eDropState.Dropped) return;

            this.CloseDropDown();
            this.Text = this.Stage + " Stage";
        }

        public string Stage
        {
            get { return ""; }
        }

    }
}
